package com.hlm.demo.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.Digits;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
import java.util.Date;

public class CostInfo implements Serializable {


    private Integer costId;
    @Pattern(regexp = "[0-9a-zA-Z_\\.\\u4e00-\\u9fa5]{1,50}$",message = "资费名称必须是由最大50长度的字母、数字、汉字和下划线的组成")
    private String costName;
    @Min(value = 1,message = "基本时长最小值不能低于1")
    @Max(value = 600,message = "基本时长最大值不能超过600")
    private Integer baseDuration;
    @Digits(integer = 6,fraction = 2,message = "基本费用只能输入0-99999.99之间的数值")
    @Min(value = 0,message = "基本费用的最小值为0.00")
    private Integer baseCost;
    @Digits(integer = 6,fraction = 2,message = "单位费用只能输入0-99999.99之间的数值")
    @Min(value = 0,message = "单位费用的最小值为0.00")
    private Integer unitCost;
    private Integer costStatus;
    @Pattern(regexp = "[0-9a-zA-Z_,\\.\\u4e00-\\u9fa5]{1,100}$",message = "资费说明必须是由最大100长度的字母、数字、汉字和下划线的组成")
    private String descr;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date creatime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date startime;
    private String costType;

    public Integer getCostId() {
        return costId;
    }

    public void setCostId(Integer costId) {
        this.costId = costId;
    }

    public String getCostName() {
        return costName;
    }

    public void setCostName(String costName) {
        this.costName = costName;
    }

    public Integer getBaseDuration() {
        return baseDuration;
    }

    public void setBaseDuration(Integer baseDuration) {
        this.baseDuration = baseDuration;
    }

    public Integer getBaseCost() {
        return baseCost;
    }

    public void setBaseCost(Integer baseCost) {
        this.baseCost = baseCost;
    }

    public Integer getUnitCost() {
        return unitCost;
    }

    public void setUnitCost(Integer unitCost) {
        this.unitCost = unitCost;
    }

    public Integer getCostStatus() {
        return costStatus;
    }

    public void setCostStatus(Integer costStatus) {
        this.costStatus = costStatus;
    }

    public String getDescr() {
        return descr;
    }

    public void setDescr(String descr) {
        this.descr = descr;
    }

    public Date getCreatime() {
        return creatime;
    }

    public void setCreatime(Date creatime) {
        this.creatime = creatime;
    }

    public Date getStartime() {
        return startime;
    }

    public void setStartime(Date startime) {
        this.startime = startime;
    }

    public String getCostType() {
        return costType;
    }

    public void setCostType(String costType) {
        this.costType = costType;
    }

    @Override
    public String toString() {
        return "CostInfo{" +
                "costId=" + costId +
                ", costName='" + costName + '\'' +
                ", baseDuration=" + baseDuration +
                ", baseCost=" + baseCost +
                ", unitCost=" + unitCost +
                ", costStatus=" + costStatus +
                ", descr='" + descr + '\'' +
                ", creatime=" + creatime +
                ", startime=" + startime +
                ", costType='" + costType + '\'' +
                '}';
    }
}
